//Static Member
//Example of a counter class 
// By Ben 20:30 26/09/2018

#include <iostream>
using namespace std;

class Counter{
public:
	static int n;
	Counter(){ n++; }
};

//Set counter class to zero
int Counter::n = 0;

int main(){
	//New counter
	Counter a;
	//Plus 5 to the counter value
	Counter b[5];
	//Show counter value now 6
	std::cout << a.n << endl;
	//Declare new counter class
	Counter *c = new Counter();
	//Output counter value is now 7
	cout << Counter::n << '\n';

	system("pause");
	return 0;
}